﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace DataForest.ViewModel.Dialogs
{
    public class ManualModel : BaseDialogModel
    {
        public ManualModel()
        {
            tokens.Add(Part.INTRO, "#_Toc358233230");
            tokens.Add(Part.TABLE, "#_Toc358233234");
            tokens.Add(Part.TREE, "#_Toc358233240");
            tokens.Add(Part.RULES, "#_Toc358233245");
            UriSource = baseSource;

        }

        private Dictionary<Part, string> tokens = new Dictionary<Part, string>();
        
        private string uriSource;
        public string UriSource
        {
            get
            {
                return uriSource;
            }
            set
            {
                if (uriSource != value)
                {
                    uriSource = value;
                    OnPropertyChanged("UriSource");
                }
            }
        }

        private string baseSource = @"Manual\manual.htm";
        public string BaseSource
        {
            get
            {
                return baseSource;
            }
        }
        private Part selectedPart;
        public Part SelectedPart
        {
            get
            {
                return selectedPart;
            }
            set
            {
                if (selectedPart != value)
                {
                    selectedPart = value;
                    UriSource = baseSource + tokens[value];
                    OnPropertyChanged("SelectedPart");
                }
            }

        }


        public enum Part
        {
            INTRO,
            TABLE,
            TREE,
            RULES
        }

    }
}
